package com.jic.product.controller.manage;


import com.jic.common.base.vo.Page;
import com.jic.common.base.vo.PageResult;
import com.jic.common.base.vo.RestResult;
import com.jic.product.entity.CategoryPropertyName;
import com.jic.product.entity.ProductPropertyName;
import com.jic.product.manage.request.ProductUploadExceptionRequest;
import com.jic.product.manage.request.ShopInfoRequest;
import com.jic.product.manage.request.UploadProductTemplateRequest;
import com.jic.product.manage.response.ProductPropertyNameResponse;
import com.jic.product.manage.response.ProductUploadExceptionResponse;
import com.jic.product.manage.response.ShopInfoResponse;
import com.jic.product.service.*;
import com.jic.util.DateUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.apache.poi.hssf.usermodel.*;
import org.apache.poi.ss.usermodel.DataFormat;
import org.apache.poi.ss.usermodel.Font;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.io.OutputStream;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;


/**
 * Created by zxk on 2020/1/9 11:04
 * 商品导出
 */
@RestController
@RequestMapping("/productUploadException")
@Api(value = "商品上传", description = "商品上传", tags = "商品上传")
@Slf4j
public class ProductUploadExceptionController {
    @Autowired
     public ProductUploadExceptionService productUploadExceptionService;

    /**
     * 商品上传历史(分页)
     *
     * @param form 商品上传历史入参实体
     * @return 商品上传历史实体列表 （分页）；
     */
    @PostMapping("/queryProductUploadHistory")
    @ApiOperation(value = "商品上传历史(分页)")
    @ResponseBody
    public RestResult<PageResult<ProductUploadExceptionResponse>> queryPage(@RequestBody ProductUploadExceptionRequest form) {
        Page page = new Page();
        page.setLimit(form.getLimit());
        page.setStart(form.getStart());
        return productUploadExceptionService.queryPage(form,page);
    }
}
